package org.terrier.matching.models;

public class KL extends WeightingModel {

	public final String getInfo() {
		return "KL";
	}
	public double score(double tf, double docLength) {
		if (tf / docLength < termFrequency / numberOfTokens)
            return 0;
        else
            return keyFrequency * tf / docLength * 
                    Idf.log(tf / docLength, 
                        termFrequency / numberOfTokens);
	}
	public double score(
			double tf,
			double docLength,
			double n_t,
			double F_t,
			double keyFrequency) {
		if (tf / docLength < F_t / numberOfTokens)
            return 0;
        else
            return keyFrequency * tf / docLength * 
                    Idf.log(tf / docLength, 
                        F_t / numberOfTokens);
	}
}